﻿$(document).ready(function () {

    $("#BC").click(function () {
        //取出相关信息
        var fbr = $("#person").val();
        var bm = $(".role").val();
        var task = {};
        task.oneer = $("#dole").val();
        task.TaskTiltle = $("#recodeTit").val();
        task.CompletionTime = $("#demo").val();
        task.TaskContent = $("#note").val();
        //如果选中的是全部
        if (task.oneer == 0) {
            $.ajax({
                type: "POST",
                url: "/Document_wait01/Recode_tail01ByMore?Publisher=" + fbr + "&DepartId=" + bm,
                data: task,
                success: function (result) {
                    if (result.success) {
                        layer.msg(result.msg, {
                            title: '提示框',
                            icon: 1,
                            time: 2000
                        });
                    } else {
                        layer.msg(result.msg, {
                            title: '提示框',
                            icon: 2,
                            time: 2000
                        });
                    }
                }
            });
        }
        //如果选中的不是全部
        else {
            $.ajax({
                type: "POST",
                url: "/Document_wait01/Publish_task?Publisher=" + fbr,
                data: task,
                success: function (result) {
                    if (result.success) {
                        layer.msg(result.msg, {
                            title: '提示框',
                            icon: 1,
                            time: 2000
                        });
                    } else {
                        layer.msg(result.msg, {
                            title: '提示框',
                            icon: 2,
                            time: 2000
                        });
                    }
                }
            });
        }

    });

})